package com.example.takeaway.config;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @author 邢晨旭
 * {@code @date} 2023/10/10
 */
@Configuration
public class MinioConfig {
    @Resource
    OssConfig ossConfig;

    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
                .endpoint(ossConfig.getEndpoint())
                .credentials(ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret())
                .build();
    }

}
